from  django.urls import path


from . import views
from rest_framework.routers import DefaultRouter
from rest_framework.urlpatterns import format_suffix_patterns
router = DefaultRouter()
router.register('menus',viewset=views.SystemMenViewSet,basename='menus')
router.register('roles',viewset=views.SystemRoleViewSet,basename='roles')
router.register('loginlogs',viewset=views.SysLoginInfoViewSet,basename='loginlogs')
router.register('operlogs',viewset=views.SysOperLogViewSet,basename='operlogs')





urlpatterns = [
    path('getRouters/', views.UserMenuList.as_view(), name='usermenus'),
    path('system/menu/roleMenuTreeselects/<str:userId>/', views.RoleMenuTreeselect.as_view(), name='roleMenuTreeselect'),
    path('system/menu/menutreeselects/', views.MenuTreeSelect.as_view(), name='menutreeselect'),
    path('system/role/changestauts/', views.ChangeRoleStatus.as_view(), name='changerolestatus'),
    #查询角色已授权用户列表
    path('allocatedList/', views.AllocatedList.as_view({'get': 'list'}), name='allocatedList'),
    #查询角色未授权用户列表
    path('unallocatedList/', views.UnAllocatedList.as_view({'get': 'list'}), name='unallocatedList'),
    #授权用户选择
    path('authuserselectall/', views.authUserSelectAll.as_view(), name='authuserselectall'),
    # 取消授权用户选择
    path('authUserCancelAll/', views.authUserCancelAll.as_view(), name='authUserCancelAll'),




]
urlpatterns = format_suffix_patterns(urlpatterns)
urlpatterns += router.urls